package com.insigma.mvc.service.mntp.impl;

import com.insigma.mvc.repository.main.dao.mntp.PMntpBzMapper;
import com.insigma.mvc.service.mntp.PMntpBzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * @author lsys
 * @email 1334364299@qq.com
 * @create 2020-09-11  15:39
 **/
@Service
public class PMntpBzServiceImpl implements PMntpBzService {
    @Autowired
    private PMntpBzMapper pMntpBzMapper;

    private HashMap<String,Object> getLowerKeyMap(HashMap<String, Object> oldMap){
        HashMap<String,Object> newMap = new HashMap<String,Object>();
        for (String key : oldMap.keySet()) {
            newMap.put(key.toLowerCase(), oldMap.get(key));
        }
        return newMap;
    }

    @Override
    public Object getList(String area_code) {
        HashMap<String, Object> map = pMntpBzMapper.getList(area_code);
        HashMap<String, Object> keyMap = getLowerKeyMap(map);
        return keyMap;
    }
}
